/**
 * @Description: 全局样式文件
 * @Author: lujq
 * @Date: 2025-01-04
 * @LastEditors: lujq
 * @LastEditTime: 2025-01-04 11:15:00
 */

/* 全局重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
}

#app {
  height: 100%;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 清除浮动 */
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* 文本省略 */
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-ellipsis-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 布局辅助类 */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-1 {
  flex: 1;
}

/* 间距辅助类 */
.m-0 {
  margin: 0;
}
.m-1 {
  margin: 8px;
}
.m-2 {
  margin: 16px;
}
.m-3 {
  margin: 24px;
}
.m-4 {
  margin: 32px;
}

.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: 8px;
}
.mt-2 {
  margin-top: 16px;
}
.mt-3 {
  margin-top: 24px;
}
.mt-4 {
  margin-top: 32px;
}

.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: 8px;
}
.mb-2 {
  margin-bottom: 16px;
}
.mb-3 {
  margin-bottom: 24px;
}
.mb-4 {
  margin-bottom: 32px;
}

.ml-0 {
  margin-left: 0;
}
.ml-1 {
  margin-left: 8px;
}
.ml-2 {
  margin-left: 16px;
}
.ml-3 {
  margin-left: 24px;
}
.ml-4 {
  margin-left: 32px;
}

.mr-0 {
  margin-right: 0;
}
.mr-1 {
  margin-right: 8px;
}
.mr-2 {
  margin-right: 16px;
}
.mr-3 {
  margin-right: 24px;
}
.mr-4 {
  margin-right: 32px;
}

.p-0 {
  padding: 0;
}
.p-1 {
  padding: 8px;
}
.p-2 {
  padding: 16px;
}
.p-3 {
  padding: 24px;
}
.p-4 {
  padding: 32px;
}

.pt-0 {
  padding-top: 0;
}
.pt-1 {
  padding-top: 8px;
}
.pt-2 {
  padding-top: 16px;
}
.pt-3 {
  padding-top: 24px;
}
.pt-4 {
  padding-top: 32px;
}

.pb-0 {
  padding-bottom: 0;
}
.pb-1 {
  padding-bottom: 8px;
}
.pb-2 {
  padding-bottom: 16px;
}
.pb-3 {
  padding-bottom: 24px;
}
.pb-4 {
  padding-bottom: 32px;
}

.pl-0 {
  padding-left: 0;
}
.pl-1 {
  padding-left: 8px;
}
.pl-2 {
  padding-left: 16px;
}
.pl-3 {
  padding-left: 24px;
}
.pl-4 {
  padding-left: 32px;
}

.pr-0 {
  padding-right: 0;
}
.pr-1 {
  padding-right: 8px;
}
.pr-2 {
  padding-right: 16px;
}
.pr-3 {
  padding-right: 24px;
}
.pr-4 {
  padding-right: 32px;
}

/* 文本对齐 */
.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}

/* 字体大小 */
.text-xs {
  font-size: 12px;
}
.text-sm {
  font-size: 13px;
}
.text-base {
  font-size: 14px;
}
.text-lg {
  font-size: 16px;
}
.text-xl {
  font-size: 18px;
}
.text-2xl {
  font-size: 20px;
}
.text-3xl {
  font-size: 24px;
}

/* 字体粗细 */
.font-normal {
  font-weight: 400;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}

/* 颜色 */
.text-primary {
  color: #409eff;
}
.text-success {
  color: #67c23a;
}
.text-warning {
  color: #e6a23c;
}
.text-danger {
  color: #f56c6c;
}
.text-info {
  color: #909399;
}
.text-muted {
  color: #999;
}
.text-white {
  color: #fff;
}
.text-black {
  color: #000;
}

/* 背景色 */
.bg-primary {
  background-color: #409eff;
}
.bg-success {
  background-color: #67c23a;
}
.bg-warning {
  background-color: #e6a23c;
}
.bg-danger {
  background-color: #f56c6c;
}
.bg-info {
  background-color: #909399;
}
.bg-white {
  background-color: #fff;
}
.bg-gray {
  background-color: #f5f5f5;
}

/* 边框 */
.border {
  border: 1px solid #dcdfe6;
}
.border-t {
  border-top: 1px solid #dcdfe6;
}
.border-b {
  border-bottom: 1px solid #dcdfe6;
}
.border-l {
  border-left: 1px solid #dcdfe6;
}
.border-r {
  border-right: 1px solid #dcdfe6;
}

/* 圆角 */
.rounded {
  border-radius: 4px;
}
.rounded-sm {
  border-radius: 2px;
}
.rounded-lg {
  border-radius: 8px;
}
.rounded-xl {
  border-radius: 12px;
}
.rounded-full {
  border-radius: 50%;
}

/* 阴影 */
.shadow {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.shadow-md {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.shadow-lg {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* 过渡动画 */
.transition {
  transition: all 0.3s ease;
}
.transition-fast {
  transition: all 0.15s ease;
}
.transition-slow {
  transition: all 0.5s ease;
}

/* 鼠标悬停效果 */
.hover-shadow:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* 卡片样式 */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  border-bottom: 1px solid #ebeef5;
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #303133;
  margin: 0;
}

/* 表格样式增强 */
.el-table {
  border-radius: 8px;
  overflow: hidden;
}

.el-table th {
  background-color: #fafafa;
  color: #606266;
  font-weight: 600;
}

/* 表单样式增强 */
.el-form-item__label {
  font-weight: 500;
  color: #606266;
}

/* 按钮样式增强 */
.el-button {
  border-radius: 6px;
  font-weight: 500;
}

/* 页面容器 */
.page-container {
  padding: 20px;
  background: #f5f5f5;
  min-height: calc(100vh - 60px);
}

.page-header {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: #303133;
  margin: 0;
}

.page-content {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .page-container {
    padding: 10px;
  }

  .page-header,
  .page-content {
    padding: 15px;
  }

  .card {
    padding: 15px;
  }
}

/* 加载状态 */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 999;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #909399;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 14px;
  line-height: 1.5;
}

/* 工具提示样式 */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #303133;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
}

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.status-tag.success {
  background: #f0f9ff;
  color: #67c23a;
  border: 1px solid #b3e19d;
}

.status-tag.warning {
  background: #fdf6ec;
  color: #e6a23c;
  border: 1px solid #f5dab1;
}

.status-tag.danger {
  background: #fef0f0;
  color: #f56c6c;
  border: 1px solid #fbc4c4;
}

.status-tag.info {
  background: #f4f4f5;
  color: #909399;
  border: 1px solid #d3d4d6;
}

/* 数据统计卡片 */
.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(30px, -30px);
}

.stat-card-title {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-card-change {
  font-size: 12px;
  opacity: 0.8;
}

/* 图表容器 */
.chart-container {
  position: relative;
  width: 100%;
  height: 400px;
}

.chart-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #909399;
}

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }

  .page-container {
    background: #fff;
    box-shadow: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
